package cn.zwx.business.order.remote;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 *  spring 容器启动完成之后，会发布一个ContextRefreshedEvent=
 *  @author zhangwenxue
 */
@Component
public class SocketServerInitial implements ApplicationListener<ContextRefreshedEvent> {

    private String port;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent event) {
        // 启动之后发布一个socket服务
        RpcProxyServer rpcProxyServer = new RpcProxyServer();
        rpcProxyServer.publisher(8006);
    }
}
